package com.example.socketio;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.CrossOrigin;

import com.corundumstudio.socketio.SocketIOServer;

import jakarta.annotation.Resource;

//在应用程序启动后，springboot将自动调用CommandLineRunner的run方法
@SpringBootApplication
@CrossOrigin(origins = "http://localhost:5173")
public class SocketioApplication  {
    @Resource
    private SocketIOServer socketIOServer;
    
//    private final SocketIOServer server;
    
//    @Override
//    public void run(String... args) throws Exception {
////        socketIOServer.start();
//    }
    public static void main(String[] args) {
        SpringApplication.run(SocketioApplication.class, args);
    }
}
